#include "OriginPCH.h"
#include "Buffer.h"
#include "Core/Renderer/Renderer.h"
#include "Core/Renderer/RendererAPI.h"
#include "Platform/OpenGL/OpenGLBuffer.h"
#include "Core/Log.h"

namespace Origin
{
    VertexBuffer* VertexBuffer::Create(float* vertices, uint32_t size)
    {
        switch (Renderer::GetAPI())
        {
        case RendererAPI::API::None:     
            ORIGIN_CORE_ASSERT(false, "None api is currently not supported!"); 
            return nullptr;
        case RendererAPI::API::OpenGL:
            return new OpenGLVertexBuffer(vertices, size);
        }
        return nullptr;
    }

    IndexBuffer* IndexBuffer::Create(uint32_t* indices, uint32_t size)
    {
        switch (Renderer::GetAPI())
        {
        case RendererAPI::API::None:
            ORIGIN_CORE_ASSERT(false, "None api is currently not supported!");
            return nullptr;
        case RendererAPI::API::OpenGL:
            return new OpenGLIndexBuffer(indices, size);
        }
        return nullptr;
    }
}